package com.itheima.d8_tcp5.ZengTest;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @ClassName server
 * @Author 16799
 * @Date 2025/9/27 11:12
 * @Version 1.0
 * @Description TODO
 **/
public class server {
    public static void main(String[] args) throws Exception {
        System.out.println("------------------服务端启动------------------");
        ServerSocket serverSocket = new ServerSocket(8877);

        while (true){
            Socket socket = serverSocket.accept();
            System.out.println("有客户端请求访问： " + socket.getRemoteSocketAddress());

            new serverThread(socket).start();
        }
    }
}
